home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / amos-tools / eaissue3a / text / r_quick_fonts.asc < prev    next >
Encoding:
Text File  |  1996-07-13  |  3.1 KB  |  75 lines

  1. ü
  2.                                  Quick Fonts
  3.                                  ~~~~~~~~~~~
  4. ý
  5.         Have you ever written an AMOS program that requires a font from
  6.     the disk, but when you are a HD user, for example, have to wait ages
  7.     and ages whilst the computer looks through, and examines hundreds of
  8.     fonts, whilst the program could be carrying on with something else?
  9.     Well hopefully, you will be able to take care of this problem using
  10.     the help and advice that I will be giving you in this little doc.
  11.     
  12. þ
  13.         This magazine boots with a fast-font maker. What it does, is
  14.     change the assign value of FONTS:, to a totally new location, where 
  15.     only the fonts for the magazine are neede, and so saves a lot of time 
  16.     with the GET FONTS command. In order to preserve true valus, I take a
  17.     reading of the original FONTS: path, and store it in memory so that I
  18.     can re-assign it after all the necessary fonts have been read.
  19.     
  20. ù
  21.         To give you a small idea of what I am actually waffling on about,
  22.     I shall explain exactly how I made the program work. When the program
  23.     boots, I set the default path to the FONTS: drawer using DIR$, and
  24.     store the value in memory. The true path will be stored in memory, not
  25. ÿ
  26. ù
  27.     just the FONTS: that I assigned it. Now I have changed the path back
  28.     to what it was when I booted up, and changed the FONTS: drawer to the
  29.     cuurent path's FONTS drawer, where everything for the magazine is
  30.     currently stored. Now I call GET FONTS, and change the original FONTS:
  31.     setting back to normal, so that if the program quits, or is
  32.     multitasking, then it will all call to the original FONTS: volume.
  33.     Here is a simple program to demonstrate what I mean :
  34.     
  35. û
  36.           A$=Dir$ : Rem Boot Path
  37.           Dir$="Fonts:" : B$=Dir$ : Rem Get Fonts Path
  38.           Dir$=A$ : Rem Change path back.
  39.           Assign "FONTS:" to A$+"/Fonts/" : Rem New Fonts Drawer
  40.           Get Fonts : Rem Retrieve the fonts list.
  41.           Set Font (All fonts to be used) : Rem Copys Fonts needed to mem.
  42.           Assign "FONTS:" To B$ : Rem Return it all back to normal.
  43.     
  44. ø
  45.         See, dead simple! It is best that you use the SET FONT command on
  46.     all the fonts that you need before you re-assign, as AMOS could look
  47.     at the re-assigned original drawer, and discover it not there.
  48.     Anyhow, once loaded into memory, they stay there until you quit out.
  49. ÿ
  50. ý
  51.         Well folks, I think that is just about it for this simple little
  52.     programming excercise. If you have any questions or queries, then why
  53.     not drop me a line at this address :
  54.     
  55. û
  56.                           Andrew "Mushroom" Kellett
  57.                                  Mushroom PD
  58.                             32 Castleton Crescent
  59.                                    Gamesley
  60.                                    Glossop
  61.                                   Derbyshire
  62.                                    SK13 9TH
  63.                                    ENGLAND
  64.     
  65. ý
  66.         All letters received will be replied to as soon as possible. I
  67.     will reply as an ASCII letter on a disk unless you state so otherwise.
  68.     
  69. ú
  70.     [Andrew "Mushroom" Kellett]
  71.     
  72. ÷
  73. EOF
  74.  
  75.